Skip to content

Add Daily Puzzle home screen widget for iOS and Android#2677

Closed
Haedong-Jeon wants to merge 2 commits intolichess-org:mainfrom
Haedong-Jeon:feat.add-home-widget-for-puzzle
Closed

Add Daily Puzzle home screen widget for iOS and Android#2677
Haedong-Jeon wants to merge 2 commits intolichess-org:mainfrom
Haedong-Jeon:feat.add-home-widget-for-puzzle

Conversation

@Haedong-Jeon
Copy link

Screenshot_1771930956

Summary

  • Add a native home screen widget that displays the daily puzzle with a rendered board image, side to move, and play count
  • Implement HomeWidgetService in Flutter that listens for daily puzzle updates and board preference changes, then pushes
    data to the native widget via the home_widget package
  • iOS widget uses WidgetKit with SwiftUI, supporting both .systemSmall and .systemMedium families; Android widget uses
    Jetpack Glance with Compose
  • Tapping the widget opens the app (and navigates to the puzzle via deep link on iOS)

Implementation Details

Flutter (Dart)

  • New HomeWidgetService (lib/src/model/home_widget/home_widget_service.dart) started in app.dart alongside other services
  • Listens to dailyPuzzleProvider and boardPreferencesProvider to keep the widget in sync
  • Renders the chessboard as a static image using StaticChessboard from the chessground package
  • Uses App Group (group.org.lichess.mobileV2) for shared data storage between the app and widget extensions

Android

  • DailyPuzzleWidget built with Jetpack Glance (androidx.glance:glance-appwidget:1.1.1)
  • DailyPuzzleWidgetReceiver extends HomeWidgetGlanceWidgetReceiver
  • Widget auto-updates every 24 hours (updatePeriodMillis: 86400000)
  • Added Kotlin Compose compiler plugin for Glance support

iOS

  • DailyPuzzleWidget WidgetKit extension with TimelineProvider
  • Supports systemSmall (board + side to move) and systemMedium (board + side to move + play count + CTA) sizes
  • Timeline refreshes hourly
  • Configured with shared App Group entitlements for both Runner and widget extension

Dependencies

  • Added home_widget: ^0.9.0 to pubspec.yaml

Test plan

  • Verify the widget appears in the home screen widget picker on both iOS and Android
  • Confirm the board image renders correctly with the user's board theme and piece set
  • Change board preferences (theme, piece set) in the app and verify the widget updates
  • Test the widget displays "Open Lichess to load" when no puzzle data is available yet
  • Verify tapping the widget opens the app
  • Test on iOS with both .systemSmall and .systemMedium widget sizes
  • Verify the widget updates when a new daily puzzle is available

@veloce
Copy link
Contributor

veloce commented Feb 24, 2026

That is really nice! Thanks for this @Haedong-Jeon

Before I review this (focusing on releasing vs. computer right now), I have a few questions. The "Test plan" section, does it mean that you have already tested it?

It would be nice to share a screen recording to see it in action, if possible on both platform.

Suggestion: it would look nicer with slightly round corners imo :)

@Haedong-Jeon
Copy link
Author

"Test Plan" refers to the checklist that you, as the maintainer of this project, need to verify before merging this pull request into the main branch. I've already checked it myself, but you need to check it as well.

Additionally, I felt that some minor feature improvements are needed, including rounding the widget's borders. Therefore, I'll close this pull request and open a new one once the work is complete.

@veloce
Copy link
Contributor

veloce commented Feb 25, 2026

Well noted about the test plan, of course I will test it.
I don't think you need to close the PR for that, you could just add more commits to it, or pass it again into a draft status. But do as you want.

I'd like to see a screen recording of the feature in action if possible, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants